package com.ruoyi.api.domain;

import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Document(value = "user")
@Data
public class UserEntity extends BaseEntity {


    private String avatar;

    private String email;

    @Field(value = "pass_word")
    private String passWord;

    @Field(value = "nick_name")
    private String nickName;

    private String googleToken;

    private String googleRefreshToken;

    public boolean isAdmin()
    {
        return isAdmin(this.email);
    }

    public static boolean isAdmin(String userId)
    {
        return userId != null ;
    }

}
